    /**
     * {{ model_class }} update.
     *
     * @param  int  $id
     * @return View
     */
    public function getEdit($id = null)
    {
        // Check if the {{ model_name }} exists
        if (is_null(${{ model_name }} = {{ model_class }}::find($id)))
        {
            // Redirect to the {{ model_class }} management page
            return Redirect::to('{{ route_prefix }}/{{ model_name }}')->with('error', "{{ model_class }} [$id] does not exist.");
        }

        // Show the page
        return View::make('{{ namespace|replace({'\\': '.'}) }}.{{ model_class }}.edit', compact('{{ model_name }}'))
{% if relations.belongsTo is defined %}
{% for related, related_model in relations.belongsTo %}
            ->with('{{ related }}_list', {{ related_model }}::lists('name', 'id'))
{% endfor %}
{% endif %}
        ;
    }

    /**
     * {{ model_class }} update form processing page.
     *
     * @param  int  $id
     * @return Redirect
     */
    public function postEdit($id = null)
    {
        // Check if the {{ model_name }} exists
        if (is_null(${{ model_name }} = {{ model_class }}::find($id)))
        {
            // Redirect to the {{ model_class }} management page
            return Redirect::to('{{ route_prefix }}/{{ model_name }}')->with('error', "{{ model_class }} [$id] does not exist.");
        }

        // Create a new validator instance from our validation rules
        $validator = Validator::make(Input::all(), $this->validationRules);

        // If validation fails, we'll exit the operation now.
        if ($validator->fails())
        {
            // Ooops.. something went wrong
            return Redirect::back()->withInput()->withErrors($validator);
        }

        // Update the {{ model_name }} data
{% for field in fields %}
        ${{ model_name }}->{{ field }} {% for i in 0..(25-(field|length)) %} {% endfor %}= e(Input::get('{{ field }}'));
{% endfor %}

        // Was the {{ model_name }} updated?
        if(${{ model_name }}->save())
        {
            // Redirect to the {{ model_class }} page
            return Redirect::to("{{ route_prefix }}/{{ model_name }}/$id/edit")->with('success', '{{ model_class }} updated successfully.');
        }

        // Redirect to the {{ model_class }} management page
        return Redirect::to("{{ route_prefix }}/{{ model_name }}/$id/edit")->with('error', '{{ model_class }} was not updated, please try again');
    }
